#ifndef FUNCTIONS_H_
#define FUNCTIONS_H_

#include <stdio.h>
#include <stdlib.h> 
#include <sys/types.h>
#include <string>
#include <cstdarg>
#include <cstddef>
#include <cstdlib>
#include <cstring>
#include <string>
#include <sstream>
#include <iostream>
#include <vector>
#include <stack>
#include <fstream>
#include <algorithm>
#include <malloc.h>
#include <sys/types.h>
#include <sys/unistd.h>
using namespace std;

#include <oslib/oslib.h>

#define RED RGB(255,0,0)
#define red RGB(255,0,0)
#define black RGB(0,0,0)
#define BLACK RGB(0,0,0)
#define white RGB(255,255,255)
#define WHITE RGB(255,255,255)
#define BLUE RGB(0,0,255)
#define blue BLUE
#define GREEN RGB(0,255,0)
#define green GREEN

extern uint getMaxCharsOnScreen(OSL_FONT *font);
extern uint getCharWidth(OSL_FONT *font);

extern char * intToString(int i);
extern void intToString(char * str, int i);
extern int stringToInt(const char * str);
extern void stringToInt(int * i,const char * str);

extern string joinString(string str1,string str2);
extern string joinString(string str1,string str2,string str3);
extern vector<string> splitString(const char* s, char c);
extern string replaceAll(const char * _str, char what, char with);

extern bool strequncase(string str1,string str2);
extern string strtoupper(string _str);
extern string strtolower(string _str);
extern bool strnocasecmp(string _str1, string _str2);

extern bool contains(vector<string> _v,string value);
extern bool contains(vector<string>_v,const char *value);

extern uint getNextOutOf(int from,int outof);
extern uint getPrevOutOf(int from, int outof);
extern string getFileType(const char * type);
extern string getFileName(string filepath);
extern void getFileName(string filepath, char *onlyName);
extern string getFileDir(string filepath);

#endif /*FUNCTIONS_H_*/
